# coding=utf8
# 全世界最帅的帅哥
from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json

transaction_bp = Blueprint("transaction", __name__, url_prefix="/transaction")
transaction_api = Api(transaction_bp)

transaction_api.representation("application/json")(output_json)

from .invest_resources import InvestResource
from .deal_record_resources import DealRecordResource
from .loan_resources import LoanApply, MyLoanApply
from .debt_resources import RepayPlan, Debt
from .match_resources import MatchUp
from .all_matched_resources import AllMatchedResource
from .invest_income_resources import InvestIncomeResource
from .matched_result_resources import MatchedResultResource

transaction_api.add_resource(InvestResource, "/invest", endpoint="invest")  # 投资记录资源类
transaction_api.add_resource(DealRecordResource, "/deal_record", endpoint="deal_record")  # 交易记录
transaction_api.add_resource(LoanApply, "/loan", endpoint="loan")  # 贷款资源类
transaction_api.add_resource(MyLoanApply, "/my_loan", endpoint="my_loan")
transaction_api.add_resource(RepayPlan, "/repay_plan", endpoint="repay_plan")
transaction_api.add_resource(Debt, "/debt", endpoint="debt")
transaction_api.add_resource(MatchUp, "/match_up", endpoint="match_up")
transaction_api.add_resource(AllMatchedResource, "/all_match", endpoint="all_match")
transaction_api.add_resource(InvestIncomeResource, "/get_income", endpoint="get_income")
transaction_api.add_resource(MatchedResultResource, "/match_result", endpoint="match_result")
